package demo.string;

public class StringStringbuffer {

	public static void main(String[] args) {
		String s1 = "asd";
		s1.concat("asds");
		System.out.println(s1);
		String s2 = "asd";
		String s3 = new String("asd");
		System.out.println("s1: " + s1);
		System.out.println("s2: " + s1);
		System.out.println("s3: " + s1);
		System.out.println("==================");
		if (s1 == s2) {
			System.out.println("s1 = s2");
		}

		if (s1 != s3) {
			System.out.println("s1 != s3");
		}

		if (s1.equals(s3)) {
			System.out.println("s1 equals s3");
		}

		System.out.println("\n\nStringbuffer");
		StringBuffer sb = new StringBuffer();
		sb.append("asd");
		sb.append(s1);
		System.out.println(sb.toString());
	}
}
